package pong.game.data;

import org.json.JSONException;
import org.json.JSONObject;

public class ObjectState {
	protected float x;
	protected float y;
	protected float vx;
	protected float vy;
	protected float ax;
	protected float ay;
	
		
	public void setX(float x) {
		this.x = x;
	}
	public float getX() {
		return x;
	}
	
	public void setY(float y) {
		this.y = y;
	}
	public float getY() {
		return y;
	}
	public void setVx(float vx) {
		this.vx = vx;
	}
	public float getVx() {
		return vx;
	}
	public void setVy(float vy) {
		this.vy = vy;
	}
	public float getVy() {
		return vy;
	}
	void setAx(float ax) {
		this.ax = ax;
	}
	float getAx() {
		return ax;
	}
	void setAy(float ay) {
		this.ay = ay;
	}
	float getAy() {
		return ay;
	}
	
	public JSONObject toJSON() {
		JSONObject json = new JSONObject();
		
		try {
			json.put("x", x);
			json.put("y", y);
			json.put("Vx", vx);
			json.put("Vy", vy);
			json.put("Ax", ax);
			json.put("Ay", ay);
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return json;
	}
	
}
